<html>
<body>

<script type="text/javascript">

function deleteRow(r)
{
var i=r.parentNode.parentNode.rowIndex;
document.getElementById('AttributeTable').deleteRow(i);
}

function AddAttribute()
{
	var rowIndex = document.getElementById("AttributeTable").rows.length ;
	var row = document.getElementById("AttributeTable").insertRow(rowIndex) ;
	
	var x=row.insertCell(0);
	var y=row.insertCell(1);
	var z=row.insertCell(2);
	var data=row.insertCell(3);
	var iid=row.insertCell(4);
	var ui=row.insertCell(5);
	var deleteButton=row.insertCell(6);

   deleteButton.innerHTML="<input type=\"button\" value=\"Delete\" onclick=\"deleteRow(this)\">"
	
	var formMain=document.getElementById("CodePattern");
	for (var i=0;i< formMain.length;i++)
	{	
		if(formMain.elements[i].name == "nameInput"  )
		{
			x.innerHTML= formMain.elements[i].value ;
		}
		
		if( formMain.elements[i].name == "dataTypeInput" )
		{
			y.innerHTML=formMain.elements[i].value ;
		}
		
		if( formMain.elements[i].name == "facetInput" )
		{
			z.innerHTML=formMain.elements[i].value ;
		}
		if( formMain.elements[i].name == "dataInput" )
		{
			data.innerHTML=formMain.elements[i].value ;
		}
		if( formMain.elements[i].name == "UIInput" )
		{
			ui.innerHTML=formMain.elements[i].value ;
		}
		if( formMain.elements[i].name == "IIDInput" )
		{
			iid.innerHTML=formMain.elements[i].value ;
		}
	}	
	
	//row += document.getElementById("dataType").value ;
	//row += document.getElementById("facet").value ;
	//row = row.concat("</table>") ;
	//document.getElementById("demo").innerHTML=row ;
	
	//document.getElementById("Attributes").innerHTML="<table border=\"1\"> <tr><th>  Name   </th><th>  Type   </th><th>  Facet  </th></tr> <tr> <td> Point </td> <td> Point </td> <td> Point </td> </table>" ;
}
personObj={firstname:"John",lastname:"Doe",age:50,eyecolor:"blue"}

//document.write(personObj.firstname + " is " + personObj.age + " years old.");

var x=document.getElementById('AttributeTable').createCaption();
x.innerHTML="Attributes";

</script>

<form id="CodePattern" >

<textarea name="copyright" title="Copyright Notice at top of each file" rows="5" cols="90">
//======================================================================================
// COPYRIGHT RAMAN RAWAT
// Author ${Author}
// Date ${pp.now?string("MMMM, yyyy")}
//======================================================================================
</textarea> <br><br>
Author <input type="text" name="author" value="Raman Rawat" size="15" title="Author Name in each file" >
Month <input type="text" name="month" value="Feb" size="4" title="" maxlength="4" >
Year <input type="text" name="year" value="2012" size="4" title="" maxlength="4">
<br><br>
Workspace  <input type="text" name="workspace" value="GEOSheetMetalWS" title="Workspace directory Name" size="20">

Trigram  <input type="text" name="trigram" value="GEO" title="All file names will start with this" size="3" maxlength="3"> <br><br />

Application Name <input type="text" name="AppName" value="SheetMetal" title="Frameworks will be created with this name" size="15" maxlength="3">

Application Trigram <input type="text" name="AppTrigram" value="Smt" title="Appended to Triagram" size="4" maxlength="4"><br><br />

Late Type  <input type="text" name="lateType" value="BendLine" title="Late Type" size="15" maxlength="15"><br><br />


 Type  
<input type="radio" name="Type" value="" title="Generate code for Feature. Catalog , Command  and interface implementations will be generated" /> Feature
<input type="radio" name="Type" value="" title="Command and logic classes will be generated" checked="checked"/> Non Feature 
<br>
<fieldset> <legend>Catalog</legend>
<font color="red">*</font>Catalog Name <input type="text" name="Catalog" value="SheetMetal" size="15" title="" >
<font color="red">*</font>Client ID <input type="text" name="ClientID" value="Geometric" size="15" title="" >
<br><br />
<div style="position:relative;width:200px;height:25px;border:0;padding:0;margin:0;">
<select style="position:absolute;top:0px;left:0px;width:200px; height:25px;line-height:20px;margin:0;padding:0;" onchange="document.getElementById('displayValue').value=this.options[this.selectedIndex].text; document.getElementById('idValue').value=this.options[this.selectedIndex].value;">
<option></option>
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
</select>
<input name="displayValue" placeholder="add/select a value" id="displayValue" style="position:absolute;top:0px;left:0px;width:183px;width:180px\9;#width:180px;height:23px; height:21px\9;#height:18px;border:1px solid #556;" onfocus="this.select()" type="text">
<input name="idValue" id="idValue" type="hidden">
</div>

Super Type <input type="text" name="superType" value="GSMGeom" title="Super Type. Valid for feature type only." size="15" maxlength="15">
Output Body Dimension <input type="text" name="outputBodyDimension" value="1" title="For Part Feature only. Enter 4 for solid." size="1" maxlength="1">
</fieldset>
<br>
<br>
Context : 
<select name="context" title="Supported Document type. ENOVIA doesn't have feature support" size="1" >
  <option value="Analysis"> Analysis </option>
  <option value="Part" selected > Part </option>
  <option value="Product"> Product </option>
  <option value="ENOVIA"> ENOVIA </option>
</select> <br/>
<br>

Feature Entity <input type="checkbox" name="FeatureEntity" title="If a IUtlEntity Derived entity is required" value="Yes" />

<p id="Attributes">Attribute Table</p>

<table id="AttributeTable" border="1" summary="Attributes" >
<tr>
	<th>  Name   </th>
	<th>  Type   </th>
	<th>  Facet  </th>
	<th>  Data  </th>
	<th>  IID  </th>
	<th>  UI  </th>
	<th>  Delete  </th>
</tr>
<tr>
	<td>  Center   </td>
	<td>  tk_specobject   </td>
	<td>  sp_IN   </td>
	<td>    </td>
	<td>  <input type="text" value="CATIMfZeroDimResult">   </td>
	<td>  <input type="text" value="List">   </td>
	<td>  <input type="button" value="Delete" onclick="deleteRow(this)">   </td>
</tr>
<tr>
	<td>  Radius   </td>
	<td>  tk_param_length   </td>
	<td>  sp_IN   </td>
	<td>  10, 1, 100, 1   </td>
	<td>     </td>
	<td>  Param   </td>
	<td>  <input type="button" value="Delete" onclick="deleteRow(this)">   </td>
</tr>
<tr>
	<td>  Comment   </td>
	<td>  tk_string   </td>
	<td>  sp_NEUTRAL   </td>
	<td>  "Circle Created by",   </td>
	<td>     </td>
	<td>  CATDlgEditor   </td>
	<td>  <input type="button" value="Delete" onclick="deleteRow(this)">   </td>
</tr>
<tr>
	<td>  Support   </td>
	<td>  tklist_specobject   </td>
	<td>  sp_IN   </td>
	<td>     </td>
	<td>  CATIMfBiDimResult   </td>
	<td>  List   </td>
	<td>  <input type="button" value="Delete" onclick="deleteRow(this)">   </td>
</tr>

</table>
<br>
<br>
<br>

<table id="attributeEdit" border="1" summary="Editable Attributes" >
<tr>
	<th>  Name   </th>
	<th>  Type   </th>
	<th>  Facet  </th>
	<th>  Data  </th>
	<th>  IID  </th>
	<th>  UI  </th>
</tr>
<tr>

<td><input type="text" name="nameInput" value="AttrName" title="Attribute name without any spaces" size="25"/> </td>
<td><select name="dataType" title="data type" size="1" > 
  <option value="tk_boolean">tk_boolean</option>
  <option value="tk_integer">tk_integer</option>
  <option value="tk_double">tk_double</option>
  <option value="tk_string">tk_string</option>
  <option value="tk_specobject">tk_specobject</option>
  <option value="tk_component">tk_component</option>
  <option value="tk_param_angle">tk_param_angle</option>
  <option value="tk_param_length">tk_param_length</option>
  <option value="tk_param_real">tk_param_real</option>
  <option value="tklist_integer">tklist_integer</option>
  <option value="tklist_double">tklist_double</option>
  <option value="tklist_string">tklist_string</option>
  <option value="tklist_specobject">tklist_specobject</option>
  <option value="tklist_component">tklist_component</option>
  <option value="tklist_entity">tklist_entity</option>
</select> </td>
<td><select name="facetInput" title="Ignored for non feature" size="1" >
  <option value="sp_IN">sp_IN</option>
  <option value="sp_OUT">sp_OUT</option>
  <option value="sp_NEUTRAL">sp_NEUTRAL</option>
</select> </td>
<td>
<input type="text" name="dataInput"  value="90, 0, 360, 1"  title="If UI is Param then enteries are default, min, max, step. If UI is CATDlgMultiList or PolyList then comma seperated column names. See HELP for ENOVIA context. " size="15"/>
</td>
<td>
<input type="text" name="IIDInput" value="CATIMfZeroDimResult" title="IID for selection. Considered with specobject and component data type only. Ignored for rest" size="30"/>
</td>
<td><select name="UIInput" title="UI control. Must match the data type." size="1" >
  <option value="Editor">CATDlgEditor</option>
  <option value="Combo">CATDlgCombo</option>
  <option value="CheckButton">CATDlgCheckButton</option>
  <option value="RadioButton">CATDlgRadioButton</option>
  <option value="SelectorList">CATDlgSelectorList</option>
  <option value="MultiList">CATDlgMultiList</option>
  <option value="Param">Param</option>
  <option value="List">List</option>
  <option value="PolyList">PolyList</option>
</select> <br/>

</tr>
</table>
<br>
<br>
<input type="button" value="Add Attribute" onclick="AddAttribute()" /> <br/>

<br>
<br>
<input type="submit" value="Generate Code" /> <br/>

</form>

</body>
</html>

